{
  LW Text -- LightWave Text

  Based on lwtext.h which is:
  Copyright 2011, NewTek, Inc.
}

{
  Copyright 2012, Jameel Halabi

  This unit is part of the BlaiseWave wrapper,
  which is licensed under the BSD 2-Clause license (see licenses/license.txt).
}

unit LW_text;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils;

const
  LWTEXTFUNCS_GLOBAL = 'LWTextureFuncs' ;

type
  PLWChar = ^TLWChar ;
  TLWChar = WideChar ;

  { String conversion functions. }
  PLWTextFuncs = ^TLWTextFuncs ;
  TLWTextFuncs = record
    // Converts a  UTF16  string to an ascii  string.
    StringToAscii  : function
                     (       Char    : PLWChar ;
                             Ascii   : PChar   ;
                             Length  : Integer ) : Integer ;
    // Converts a  UTF16  string to a  UTF8   string.
    StringToUTF8   : function
                     (       Char    : PLWChar ;
                             Ascii   : PChar   ;
                             Length  : Integer ) : Integer ;
    // Converts a  UTF16  string to an export string.
    StringToExport : function
                     (       Char    : PLWChar ;
                             Ascii   : PChar   ;
                             Length  : Integer ) : Integer ;
    // Converts an ascii  string to a  UTF16  string.
    ASCIIToString  : function
                     (       Ascii   : PChar   ;
                             Char    : PLWChar ;
                             Length  : Integer ) : Integer ;
    // Converts a  UTF8   string to a  UTF16  string.
    UTF8ToString   : function
                     (       Ascii   : PChar   ;
                             Char    : PLWChar ;
                             Length  : Integer ) : Integer ;
    // Converts an import string to a  UTF16  string.
    ImportToString : function
                     (       Ascii   : PChar   ;
                             Char    : PLWChar ;
                             Length  : Integer ) : Integer ;
    // Allocates a new string and copies to it.
    StringCopy     : function
                     (       Char    : PLWChar ) : PLWChar ;
    // Free a string that was allocated.
    StringFree     : function
                     (       Char    : PLWChar ) : Integer ;
  end;

implementation

end.

